Problem: A two-gallon container had all of its dimensions tripled. How many gallons does the new container hold?
Answer: Suppose that our two-gallon container is in the shape of a rectangular prism. If we triple the length, the volume triples. Tripling the width or the height gives us the same result. Therefore, tripling all of the dimensions increases the volume by a factor of $3\cdot 3 \cdot 3 = 27$. The new container can hold $2 \times 27 = \boxed{54}$ gallons.